﻿@model DataAccess.DB.DVCC

@{
    ViewBag.Title = "Đơn vị cung cấp";
}
<div class="panel panel-default">
    <div class="panel-heading">
        Tạo mới Đơn vị cung cấp
    </div>
    <!-- /.panel-heading -->
    <div class="panel-body">
        <div class="row">
            <div class="col-lg-6">
                @using (Html.BeginForm())
                {
                    @Html.ValidationSummary(true)
                    <div class="form-group">
                        <label>Mã ĐVCC</label>
                        @Html.TextBoxFor(model => model.MaDVCC, null, new { @class="form-control" })
                        @Html.ValidationMessageFor(model => model.MaDVCC)
                    </div>

                    <div class="form-group">
                        <label>Tên ĐVCC</label>
                        @Html.TextBoxFor(model => model.TenDVCC, null, new { @class="form-control" })
                        @Html.ValidationMessageFor(model => model.TenDVCC)
                    </div>

                    <div class="form-group">
                        <label>Mã số thuế</label>
                        @Html.TextBoxFor(model => model.MaSoThue, null, new { @class="form-control" })
                        @Html.ValidationMessageFor(model => model.MaSoThue)
                    </div>

                    <div class="form-group">
                        <label>Địa chỉ</label>
                        @Html.TextAreaFor(model => model.DiaChi, 6, 100, new { @class="form-control" })
                        @Html.ValidationMessageFor(model => model.DiaChi)
                    </div>

                    <div class="form-group">
                        <label>Số điện thoại</label>
                        @Html.TextBoxFor(model => model.SDT, null, new { @class="form-control" })
                        @Html.ValidationMessageFor(model => model.SDT)
                    </div>

                    <div class="form-group">
                        <label>Tổng nợ</label>
                        @Html.TextBoxFor(model => model.TongNo, null, new { @class="form-control" })
                        @Html.ValidationMessageFor(model => model.TongNo)
                    </div>

                    <button type="submit" class="btn btn-default">Cập nhật</button>
                    @Html.ActionLink("Thoát", "Index", null, new { @class = "btn btn-default" })
                }
            </div>
        </div>
    </div>
    <!-- /.panel-body -->
</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
    <script type="text/javascript">
        $("#TongNo").change(function () {
            $("#TongNo").formatCurrency();
            var num = '0';
            num = $this.val().replace(/,/g, '').replace('.', '');
            if (num === '' || isNaN(num)) {
                $this.val('0.00');
            }
        });
    </script>
}
